import axios from '../../plugins/axios.js'

const state = {
	cloumn:[]   //相当于data:[]
}

const actions = {
	column({state,commit},{_limit,_page}){
		//判断payload是不是数组
		axios.get(`/news/column`,{params:{_limit:_limit||30,_page:_page||1}}).then(
			res=>{
				//success ?->判断
				commit('column',res.data)
			}
		)
	}
}

const mutations = {
	column:(state,payload)=>state.column=payload
}

export default {
	namespaced:true,
	state,actions,mutations
}
